﻿using Qzb.MicroService.Interface;
using Qzb.MicroService.Model;

namespace Qzb.MicroService.Service
{
    public class UserService : IUserService
    {
        private readonly List<User> _users = new List<User>()
        {
            new User() { Id = 1, Name = "张三" },
            new User() { Id = 2, Name = "李四" },
            new User() { Id = 3, Name = "王五" },
            new User() { Id = 4, Name = "赵六" }
        };

        public User? GetUser(int id)
        {
            return _users.FirstOrDefault(x => x.Id == id);
        }

        public IEnumerable<User> GetUsers()
        {
            return _users;
        }
    }
}